#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n, sum = 0;
    int m;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", &m);
        sum += m;
    }
    int count = 0;
    for (int i = 1; i <= 5; ++i)
    {
        if ((sum + i) % (n + 1) != 1 )
        {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}